"""
@file:   user.py
@author: Shuai
@date:   2020/04/30
"""
from .base import db


# 用户信息表
class User(db.Model):
    __tablename__ = 'user'
    user_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    user_name = db.Column(db.String(128), nullable=False)
    user_email = db.Column(db.String(50), nullable=False)
    user_phone = db.Column(db.String(128), nullable=False)
    user_passwd = db.Column(db.String(256), nullable=False)
    user_image = db.Column(db.LargeBinary(length=2048))
    user_fans = db.Column(db.Integer)
    user_attention = db.Column(db.Integer)


# 注册验证码表
class Sms_phone(db.Model):
    __tablename__ = 'sms_phone'
    phone_num = db.Column(db.String(128), primary_key=True, nullable=False)
    sms_num = db.Column(db.String(128), nullable=False)